#coding=utf8
from django.db import connection
# import logging
from website.settings import LOGGER as logger
class PrintSQL(object):
    def process_response(self, request,response):
        temp = 0
        count =0
        try:
            for x in connection.queries:
                logger.debug(x)
                count+=1
                temp += float(x['time'])
#             logging.info('执行',count,'条SQL,共耗时',temp)
            logger.debug('执行%d条SQL,共耗时%.2f'%(count,temp))
        except :
            pass
        return response